// components/tabbar/tabbar.js
const app = getApp()
Component({
  data: {
    toBottom:0,
    selected: 0,
    color: "#7A7E83",
    selectedColor: "#0085ff",
    list: [{
      pagePath: "/pages/bar/index/index",
      iconPath: "/images/icon_index.png",
      selectedIconPath: "/images/icon_index1.png",
      text: "首页"
    },
    {
      pagePath: "/pages/bar/me/me",
      iconPath: "/images/icon_me.png",
      selectedIconPath: "/images/icon_me1.png",
      text: "我的"
    }
  ]
  },
  attached() {
  },
  
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path;
      wx.switchTab({url})
      this.setData({
        selected :data.index
      })
    },
    navigateTo(e){
      wx.navigateTo({
        url: '/pages/fill/fill',
      })
    }
  },
  ready:function(){
    let that = this;
    // 控制tabbar的样式
    if(app.globalData.model == 'iPhone X'|| app.globalData.model== "iPhone XR" || app.globalData.model== "iPhone XS Max"){
      // console.log('sss',that);
      that.setData({
        toBottom:170,
        toBottomTxt:70
      })
    }
  },
  created: function () {
    let that = this;
    // console.log('[tabbar-component] created',app.globalData)
  
    let windowHeight = app.globalData.windowHeight
    if(windowHeight < 700 ){
      
    }
    if(windowHeight > 700 ){

    }
  },
})